import * as Cookies from 'js-cookie';
import * as Definitions from './containers/Definitions';

export function getMyToken({ My }) {
  return My.Session.token || Cookies.get(Definitions.ACCESS_TOKEN_KEY);
}

export function calculatePageCount(totalCount, limit) {
  return parseInt(totalCount / limit, 10) + (totalCount % limit > 0 ? 1 : 0);
}
